home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 17857 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.7 KB

  1. Path: news.rain.org!usenet
  2. From: "Guus Leeuw jr." <guusl@eiffel.com>
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Why don't you use garbage collection
  5. Date: Wed, 17 Apr 1996 13:28:32 -0700
  6. Organization: Interactive Software Engineering Inc. http://www.eiffel.com/
  7. Message-ID: <31755470.3D85BB11@eiffel.com>
  8. References: <AD94A731966836BF@dialup97-6-14.swipnet.se> <1996Apr16.110526.1846@ittpub> <AD9A9E819668CB68B@dialup100-3-15.swipnet.se> <4l2qc9$oek@ubszh.fh.zh.ubs.com>
  9. NNTP-Posting-Host: @outback.eiffel.com
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 2.0 (X11; I; Linux 1.2.8 i586)
  14.  
  15. Ian Johnston (by ubsswop) wrote:
  16. > In article <AD9A9E819668CB68B@dialup100-3-15.swipnet.se>, lars.farm@nts.mh.se (Lars Farm) writes:
  17. > |> In article <1996Apr16.110526.1846@ittpub>,
  18. > |> wil@ittpub.nl (Wil Evers) wrote:
  19. > |>
  20. > |> >OK, let's get serious about this:
  21. > |> >
  22. > |> >1. Don't we think C++ is complex enough as it is?
  23. > |>
  24. > |> See the Detlefs/Ellis GC proposal. Seems a fairly small change in the
  25. > |> language compared to what is done with templates and exceptions and rtti,
  26. > |> and... A couple of keywords: gc/nogc to be used optionally with class
  27. > |> declarations and optionally with operator new to select collected or non
  28. > |> collected heap. Later gc/nogc overrides previous. There is a way to
  29. > |> finalize, but the need for this is made much smaler. What is inside most
  30. > |> copy/op=/dtors? Code to copy heap data and release data held by pointers.
  31. > |> What would copy/op=/dtors look like when pointers can be shared and you
  32. > |> don't have to say delete? Many of them would become redundant! The
  33. > |> (current) compiler generated op= and copy would very often suffice. The
  34. > |> minority of objects with non empty dtors would be deleted manually just
  35. > |> like now. This makes things simpler, not harder.
  36. > Well, most of your classes may manage memory in ctors/dtors/op =, but
  37. > I have many many classes which manage other resources, not memory. In fact,
  38. > the classes I have which manage memory are in the minority.
  39. > So, how does the Detlefs/Ellis, or any other GC, finalise my non-memory
  40. > resources?
  41.  
  42. I don't know about Detlefs/Ellis GC (didn't follow this thread completely) but there
  43. is a GC out there, that calls a special function before actually destorying the
  44. object. The default body would be empty, and the user can override that default to
  45. close files or whatever.
  46.  
  47. -- 
  48. 'l8r,
  49.     Guus
  50. ---------------------------------------------------------------------------
  51. They say I'm wild and I'm reckless.
  52.     -- Jim Steinman (from the song: Everything louder than everything else)
  53. ---------------------------------------------------------------------------
  54.